import { ref } from 'vue'
import { defineStore } from 'pinia'

export const useEditorCodeStore = defineStore('editorCode', () => {
  const componentList = ref([])

  function addComponent(component) {
    componentList.value.push(component)
  }

  function removeComponent(component) {
    componentList.value.splice(componentList.value.indexOf(component), 1)
  }

  return { componentList, addComponent, removeComponent }
})
